﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FirstForm
{
    public class Player : Character
    {
        public Player()
        {
            this.HP = 50;
            this.TotalHP = 50;
            this.SkillPoints = 80;
            this.Int = 5;
            this.Str = 5;
            this.Dex = 5;
            this.Hrd = 4;
            this.WIL = 4;
            this.Apr = 1;
            this.Def = 1;
            this.Inventory = new List<Item>();
        }

        public int SkillPoints { get; set; }

        public List<Item> Inventory { get; set; }

        public int DodgeRoll()
        {
            Random r = new Random();
            return r.Next(1, 8) + this.Dex - this.ArmorPenalty;
            //Too whom this return concerns: Recommended that Dodge DC be at least 7.
        }

        public int ArmorPenalty
        {
            get
            {
                int AP = 0;
                foreach (Item a in this.Inventory.FindAll(i => i is Item))
                {
                    AP += a.Weight;
                }
                return AP;
            }
        }
    }

}
